//
//  CYTXView.swift
//  CreditAddressBook
//
//  Created by Lee on 15/8/18.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

import UIKit

class CYTXView: UIView {

    @IBOutlet weak var headView: UIImageView!

    @IBOutlet weak var nameLabel: UILabel!
    
    var headImage:UIImage! {
        didSet {
            
            self.headView.image = self.headImage
            self.headView.layer.masksToBounds = true
            self.headView.layer.cornerRadius = 50
            self.headView.layer.borderColor = UIColor.white.cgColor
            self.headView.layer.borderWidth = 4
        }
    }
    
    var name:String! {
        didSet {
            
            self.nameLabel.text = self.name
        }
    }
    
    func txView(name:String) -> CYTXView {
        let arr:NSArray = Bundle.main.loadNibNamed("CYTXView", owner: nil, options: nil) as! NSArray
        let contentView = arr.lastObject as! CYTXView
        return contentView
    }
    
    deinit {
        print("向TA挑衅销毁")
    }
}
